def recursion(x):
    if x >= 3:
        return
    print(f"进入层 {x}")
    recursion(x + 1)
    print(f"返回层 {x}")  # x 仍是当前层的值

recursion(0)